package com.hdu.pyl.model;

import lombok.Data;

/**
 * 文章标签
 */
public enum TagsEnum {
    WEIGHTDOWN("体重偏瘦", -1),
    WEIGHTRIGHT("体重正常", 0),
    WEIGHTUP("体重偏胖", 1),
    HEIGHTDOWN("身高偏低", -1),
    HEIGHTRIGHT("身高正常", 0),
    HEIGHTUP("身高偏高", 1),
    HEADDOWN("头围偏小", -1),
    HEADRIGHT("头围正常", 0),
    HEADUP("头围偏大", 1),
    BMIDOWN("BMI偏低", -1),
    BMIRIGHT("BMI正常", 0),
    BMIUP("BMI偏高", 1),
    BODYFATDOWN("体脂偏低", -1),
    BODYFATRIGHT("体脂正常", 0),
    BODYFATUP("体脂偏高", 1);
    private String message;
    private int code;

    private TagsEnum(String message, int code) {
        this.message = message;
        this.code = code;
    }

    public static String getMessage(int code) {
        for (TagsEnum e : TagsEnum.values()
        ) {
            if (e.getCode() == code) {
                return e.getMessage();
            }
        }
        return null;
    }

    public String getMessage() {
        return message;
    }

    public int getCode() {
        return code;
    }

}
